package com.google.fbyoutube.shared;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class ytComment implements Serializable {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	Long key;
	
	@Persistent
	public Long fbId = null;
	
	@Persistent
	public String vodId = null;
	
	@Persistent
	public String title = null;
	
	@Persistent
	public String type = null;
	
	@Persistent
	public String content = null;
	
	@Persistent
	public String link = null;
	
	@Persistent
	public String author = null;
	
	@Persistent
	public Date time = null;
	
	// We need a zero argument constructor here,
	// or program throws serialization exception.
	public ytComment() {
		this.title = "";
		this.content = "";
		this.link = "";
		this.type = "TEXT";
	}
	
	public ytComment(String title, String content, String link) {
		this.title = title;
		this.content = content;
		this.link = link;
		this.type = "TEXT";
	}
	
	public String getTitle() {
		if (title == null)
			title = "";
		return title;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getType() {
		return type;
	}
	
	public void setType(String type) {
		this.type = type;
	}
	
	public String getContent() {
		if (content == null)
			content = "";
		return content;
	}
	
	public void setContent(String content) {
		this.content = content;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public Long getFbId() {
		return fbId;
	}

	public void setFbId(Long fbId) {
		this.fbId = fbId;
	}

	public String getVodId() {
		return vodId;
	}

	public void setVodId(String vodId) {
		this.vodId = vodId;
	}
}
